]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnails: Only show for more than two workspaces
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 16 Feb 2021 19:15:21 +0000 (20:15 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 19 Feb 2021 00:13:05 +0000 (01:13 +0100)
As adjacent workspaces now peek into the window picker, the first
two workspaces are already accessible without the minimap. Hide
it in that case to give more space to the window picker, and to
not clutter the overview for users who aren't using workspaces.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3739

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1696>

js/ui/workspaceThumbnail.js

index 6f009b8a088081598215bc32c1d19a41921290dc..933a0d5d4ad8eb358e312ffc9311883897024e1a 100644 (file)
@@ -8,6 +8,8 @@ const Main = imports.ui.main;
 const Util = imports.misc.util;
 const Workspace = imports.ui.workspace;
 
+const NUM_WORKSPACES_THRESHOLD = 2;
+
 // The maximum size of a thumbnail is 5% the width and height of the screen
 var MAX_THUMBNAIL_SCALE = 0.05;
 
@@ -718,8 +720,9 @@ var ThumbnailsBox = GObject.registerClass({
 
     _updateShouldShow() {
         const { nWorkspaces } = global.workspace_manager;
-        const shouldShow =
-            this._settings.get_boolean('dynamic-workspaces') || nWorkspaces > 1;
+        const shouldShow = this._settings.get_boolean('dynamic-workspaces')
+            ? nWorkspaces > NUM_WORKSPACES_THRESHOLD
+            : nWorkspaces > 1;
 
         if (this._shouldShow === shouldShow)
             return;